package edu.ccut.saturn.studio.menuitem.editor;

import org.eclipse.ui.PartInitException;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.w3c.dom.Document;


import edu.ccut.saturn.studio.core.util.eclipse.SaturnXMLFormEditor;
import edu.ccut.saturn.studio.menuitem.model.MenuItemModel;
import edu.ccut.saturn.studio.menuitem.page.MenuItemsPage;

public class MenuItemsEditor extends SaturnXMLFormEditor {

	private MenuItemModel menuItemModel;

	private MenuItemsPage menuItemsPage;
	public static final String SATURN_MENUITEMS_EDITOR = MenuItemsEditor.class
	.getName();
	
	public MenuItemModel getMenuItemModel() {
		return menuItemModel;
		
	}
	protected void addFormPages() throws PartInitException {
		menuItemsPage = new MenuItemsPage(this);
		super.addPage(0, menuItemsPage);
	}

	protected void initModel() {
		StructuredTextEditor sourcePage = super.getTextEditor();
		menuItemModel = new MenuItemModel((Document) sourcePage
				.getAdapter(Document.class));
	}
}
